package com.lqd.mall.jpa.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Optional;

/**
 * @author 零起点
 * @create 2022-03-05 10:17
 */
@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends JpaRepository<T, ID> {


    @Modifying
    @Transactional
    Optional<Integer> delectEntity(T entity);

    @Modifying
    @Transactional
    Optional<Integer> updateEntity(T entity, String[] attribute);

}
